package com.neuedu.studentmanage.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginOutController {
	
	private Logger logger = Logger.getLogger(LoginController.class);
	
	@RequestMapping("/user/logout")
	public String loginOut(HttpServletRequest request) {
		HttpSession session = request.getSession();
		if (session != null) {
			session.invalidate();
		}
		logger.info("退出系统成功！");
		return "redirect:/login";
	}

}
